/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.me.entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "T_DISTRITOS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TDistritos.findAll", query = "SELECT t FROM TDistritos t ORDER BY t.nIdDistritoPk"),
    @NamedQuery(name = "TDistritos.findByNIdDistritoPk", query = "SELECT t FROM TDistritos t WHERE t.nIdDistritoPk = :nIdDistritoPk"),
    @NamedQuery(name = "TDistritos.findByVNombreDistrito", query = "SELECT t FROM TDistritos t WHERE t.vNombreDistrito = :vNombreDistrito"),
    @NamedQuery(name = "TDistritos.findByNNumHabitantesDistrito", query = "SELECT t FROM TDistritos t WHERE t.nNumHabitantesDistrito = :nNumHabitantesDistrito")})
public class TDistritos implements Serializable {
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nIdDistritoDomicilioNotFk")
    private List<TNotarias> tNotariasList;
    
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "N_ID_DISTRITO_PK")
    private Short nIdDistritoPk;
    @Column(name = "V_NOMBRE_DISTRITO")
    private String vNombreDistrito;
    @Column(name = "N_NUM_HABITANTES_DISTRITO")
    private Integer nNumHabitantesDistrito;
    @OneToMany(mappedBy = "nIdDistritoDomicilioCteFk")
    private List<TClientes> tClientesList;
    @OneToMany(mappedBy = "nIdDistritoCentroTrabaFk")
    private List<TClientes> tClientesList1;
    @JoinColumn(name = "N_ID_PROVINCIA_FK", referencedColumnName = "N_ID_PROVINCIA_PK")
    @ManyToOne
    private TProvincias nIdProvinciaFk;

    public TDistritos() {
    }

    public TDistritos(Short nIdDistritoPk) {
        this.nIdDistritoPk = nIdDistritoPk;
    }

    public Short getNIdDistritoPk() {
        return nIdDistritoPk;
    }

    public void setNIdDistritoPk(Short nIdDistritoPk) {
        this.nIdDistritoPk = nIdDistritoPk;
    }

    public String getVNombreDistrito() {
        return vNombreDistrito;
    }

    public void setVNombreDistrito(String vNombreDistrito) {
        this.vNombreDistrito = vNombreDistrito;
    }

    public Integer getNNumHabitantesDistrito() {
        return nNumHabitantesDistrito;
    }

    public void setNNumHabitantesDistrito(Integer nNumHabitantesDistrito) {
        this.nNumHabitantesDistrito = nNumHabitantesDistrito;
    }

    @XmlTransient
    public List<TClientes> getTClientesList() {
        return tClientesList;
    }

    public void setTClientesList(List<TClientes> tClientesList) {
        this.tClientesList = tClientesList;
    }

    @XmlTransient
    public List<TClientes> getTClientesList1() {
        return tClientesList1;
    }

    public void setTClientesList1(List<TClientes> tClientesList1) {
        this.tClientesList1 = tClientesList1;
    }

    public TProvincias getNIdProvinciaFk() {
        return nIdProvinciaFk;
    }

    public void setNIdProvinciaFk(TProvincias nIdProvinciaFk) {
        this.nIdProvinciaFk = nIdProvinciaFk;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nIdDistritoPk != null ? nIdDistritoPk.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TDistritos)) {
            return false;
        }
        TDistritos other = (TDistritos) object;
        if ((this.nIdDistritoPk == null && other.nIdDistritoPk != null) || (this.nIdDistritoPk != null && !this.nIdDistritoPk.equals(other.nIdDistritoPk))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.me.entityBeans.TDistritos[ nIdDistritoPk=" + nIdDistritoPk + " ]";
    }

    @XmlTransient
    public List<TNotarias> getTNotariasList() {
        return tNotariasList;
    }

    public void setTNotariasList(List<TNotarias> tNotariasList) {
        this.tNotariasList = tNotariasList;
    }

    
   
}
